package com.losl.common.core.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.losl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author maxwell
 * @since 2021-05-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@TableName("losl_user")
public class SysUser extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * 用户ID
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    /**
     * 用户名
     */
    @Size(min = 1,max = 20,message = "登录名长度错误")
    private String username;

    /**
     * 用户密码
     */
    @Size(min = 6,max = 12,message = "密码长度错误")
    @JSONField(serialize = false)
    private String password;

    /**
     * 用户昵称
     */
    @Size(min = 1,max = 20,message = "用户昵称长度错误")
    private String nickName;

    /**
     * 用户角色
     */
    private Integer role;

    /**
     * 用户手机号
     */
    private String mobile;

    /**
     * 用户状态，0：账户停用，1：正常使用
     */
    private String status;

    /**
     * 性别，0：女，1：男
     */
    private String gender;

    /**
     * 用户邮箱
     */
    @Email(message = "邮箱格式错误")
    private String email;

    /**
     * 头像
     */
    private String profile;
}
